package com.yyt.module_main.act;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.yyt.libsrc.bean.CreatecodeBean;
import com.yyt.libsrc.conf.Consts;
import com.yyt.libsrc.net.JavaParamsBuilder;
import com.yyt.libsrc.net.NetUtil;
import com.yyt.libsrc.net.SuccessCallback;
import com.yyt.libsrc.router.RouteTable;
import com.yyt.module_main.R;
import com.yyt.module_main.databinding.ActivityInvitationCodeBinding;
import com.yyt.module_main.vm.InvitaionCodeVM;

import top.lixb.libcommon.base.RefreshableActivity;

@Route(path = RouteTable.main_invitation_code)
public class InvitationCodeActivity extends RefreshableActivity<ActivityInvitationCodeBinding> {

    private InvitaionCodeVM mVm;

    @Override
    protected void init() {
        mVm = new InvitaionCodeVM();
        mRefreshContentBinding.setVm(mVm);
        setTitle("分享二维码");
    }

    @Override
    protected int initRefreshLayout() {
        return R.layout.activity_invitation_code;
    }

    @Override
    protected void getData(boolean refresh) {
        NetUtil.sellerPost(new JavaParamsBuilder()
                .addCmd(Consts.CMD.createcode)
                .addP("inviteCode",mVm.inviteCode.get())
                .build(), new SuccessCallback<CreatecodeBean>() {
            @Override
            public void onSuccess(CreatecodeBean createcodeBean) {

            }
        });
    }
}
